"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from .views import viewsIndex,viewsUsers,viewsCates,viewsGoods,authviews,viewsOrders

urlpatterns = [
    #后端首页路由
    url(r'^$', viewsIndex.index,name='myadmin_index'),
    url(r'^login/$', viewsIndex.myadminlogin,name='myadmin_login'),
    url(r'^verifycode/$', viewsIndex.verifycode,name='myadmin_verifycode'),
    url(r'^logout/$', viewsIndex.myadminlogout,name='myadmin_logout'),


    #后台权限管理
    # 后台用户添加
    url(r'^auth/user/add$',authviews.useradd,name='auth_user_add'),
    # 后台用户列表
    url(r'^auth/user/list$',authviews.userlist,name='auth_user_list'),
    url(r'^auth/user/del/(?P<uid>[0-9]+)$',authviews.userdel,name='auth_user_del'),
    # 后台组添加
    url(r'^auth/group/add$',authviews.groupadd,name='auth_group_add'),
    # 后台组列表
    url(r'^auth/group/list$',authviews.grouplist,name='auth_group_list'),
    url(r'^auth/group/edit/(?P<gid>[0-9]+)$',authviews.groupedit,name='auth_group_edit'),


    #会员管理
    #会员添加
    url(r'^user/add/$', viewsUsers.useradd,name='myadmin_user_add'),
    #会员列表
    url(r'^user/index/$', viewsUsers.userindex,name='myadmin_user_index'),
    #会员逻辑删除
    url(r'^user/del/(?P<uid>[0-9]+)/$', viewsUsers.userdel,name='myadmin_user_del'),
    #会员逻辑删除用户列表
    url(r'^user/deletelist/$', viewsUsers.userdeletelist,name='myadmin_user_deletelist'),
    #会员编辑
    url(r'^user/edit/(?P<uid>[0-9]+)/$', viewsUsers.useredit,name='myadmin_user_edit'),
    #会员黑名单
    url(r'^user/blackadd/(?P<uid>[0-9]+)/$', viewsUsers.userblackadd,name='myadmin_user_blackadd'),
    #会员黑名单列表
    url(r'^user/blacklist/$', viewsUsers.userblacklist,name='myadmin_user_blacklist'),
    #会员解除黑名单
    url(r'^user/blackopen/(?P<uid>[0-9]+)/$', viewsUsers.userblackopen,name='myadmin_user_blackopen'),
    
    #商品分类管理
    #商品添加
    url(r'^cates/add/$', viewsCates.catesadd,name='myadmin_cates_add'),
    #商品分类列表
    url(r'^cates/index/$', viewsCates.catesindex,name='myadmin_cates_index'),
    #商品逻辑删除
    url(r'^cates/del/$', viewsCates.catesdel,name='myadmin_cates_del'),
    #商品分类逻辑删除列表
    url(r'^cates/deletelist/$', viewsCates.catesdeletelist,name='myadmin_cates_deletelist'),
    #商品分类删除
    url(r'^cates/delete/$', viewsCates.catesdelete,name='myadmin_cates_delete'),
    #商品分类还原
    url(r'^user/catesopen/(?P<pid>[0-9]+)/(?P<cid>[0-9]+)/$', viewsCates.catesopen,name='myadmin_user_open'),
    #商品分类修改
    url(r'^cates/edit/$', viewsCates.catesedit,name='myadmin_cates_edit'),

    # 商品管理
    # 商品添加
    url(r'^goods/add/$', viewsGoods.goodsadd,name='myadmin_goods_add'),
    # 商品添加,显示
    url(r'^goods/insert/$', viewsGoods.goodsinsert,name='myadmin_goods_insert'),
    # 商品列表
    url(r'^goods/index/$', viewsGoods.goodsindex,name='myadmin_goods_index'),
    # 商品下架
    url(r'^goods/del/(?P<gid>[0-9]+)/$', viewsGoods.goodsdel,name='myadmin_goods_del'),
    #商品下架列表
    url(r'^goods/deletelist/$', viewsGoods.goodsdeletelist,name='myadmin_goods_deletelist'),
    #商品删除
    url(r'^goods/delete/(?P<gid>[0-9]+)/$', viewsGoods.goodsdelete,name='myadmin_goods_delete'),
    #商品上架
    url(r'^goods/open/(?P<gid>[0-9]+)/$', viewsGoods.goodsopen,name='myadmin_goods_open'),
    #商品编辑
    url(r'^goods/edit/(?P<gid>[0-9]+)/$', viewsGoods.goodsedit,name='myadmin_goods_edit'),
 
    #订单管理
    #订单列表
    url(r'^orders/index/$', viewsOrders.ordersindex,name='myadmin_orders_index'),
    #订单状态修改
    url(r'^orders/edit/(?P<oid>[0-9]+)/$', viewsOrders.ordersedit,name='myadmin_orders_edit'),

]
